/**
 * JAVACC DEMO 1.0
 * @copy right dwusoft company All rights reserved. 
 * @Package com.apache.uct.service.plugins  
 */
package com.apache.uct.service.plugins;

import java.util.HashMap;
import java.util.Map;

import com.apache.api.manager.PluginConnector;
import com.apache.api.vo.ParamsVo;
import com.apache.api.vo.ResultEntity;
import com.apache.database.constant.SystemTools;
import com.apache.database.constant.Validator;

/**
 * description:  获取纺一配置信息内容
 * @author dwusoft 创建时间：2015-3-30  
 * @Copyright(c)2014:北京--软件技术有限公司
 */
public class UnitySystemConfigPlugin implements PluginConnector {

	/**
	 * TODO 获取纺一配置信息内容.  <br>
	 */
	public Object execute(ParamsVo arg0) throws Exception {
		ResultEntity result = new ResultEntity();
		result.setResult("true");
		Map<String, String> config = new HashMap<String, String>();
		try {
			Map<String, String> map = SystemTools.getInstance().getMap();
			if (!Validator.isEmpty(map)) {
				for (String key : map.keySet()) {
					if (key.startsWith("unity_")) {
						config.put(key.replaceAll("unity_", ""), map.get(key));
					}
				}
			}
			result.setEntity(config);
			result.setMessage("获取用户中心配置信息成功");
		} catch (Exception e) {
			result.setResult("false");
			result.setMessage("发生未知异常！");
		}
		return result;
	}

}
